/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ImageFileSelector;

import java.io.File;
import javax.swing.ImageIcon;
import javax.swing.JPanel;

/**
 *
 * 
 */
public class LoadImage {
    static public void inPanel(JPanel jPanel,File file){
        ImageIcon img; 

        //get image from file
        img = new ImageIcon(file.getPath());

        // scale image from 
        ImageIcon img2 = restaurantguide.utils.Utils.scale(img.getImage(), 200, jPanel.getTopLevelAncestor());
        
        // paint on screen
        img2.paintIcon(jPanel, jPanel.getTopLevelAncestor().getGraphics(), 0,0);
    }
}
